package com.laikan.reader.bookstart.activity;

import android.content.Intent;
import android.view.View;
import android.widget.RelativeLayout;
import com.laikan.library.utils.SPUtil;
import com.laikan.reader.R;
import com.laikan.reader.bookstore.base.BasicWebViewActivity;

/**
 * Created by admin on 2016/11/8.
 * 广告web页
 */
public class PosterWeb extends BasicWebViewActivity {

    @Override
    protected void assignViews() {
        super.assignViews();
        //        iv_back.setVisibility(View.GONE);
        iv_search.setVisibility(View.GONE);
    }

    @Override
    protected void initData() {
        super.initData();
        String url = getIntent().getStringExtra("url");
        String title = getIntent().getStringExtra("title");
        super.setPageLoadData(title, url);
    }

    @Override
    protected void setListener() {
        super.setListener();

        iv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                checkLogin();
                finish();
            }
        });
    }

    @Override
    public void onBackPressed() {
//        super.onBackPressed();
        checkLogin();
        finish();
//        this.overridePendingTransition(0, R.anim.sliding_out_from_bottom_anim);
    }

    private void checkLogin() {
        //        if (SPUtil.getString("token", "").equals("")) {
        //            startActivity(new Intent(mContext, GuideActivity.class));
        //        }else {
        Intent intent = new Intent(mContext, HomeActivity.class);
        intent.putExtra("login_type", "login_custom");
        startActivity(intent);
        //        }
    }
}
